package com.xqboss.apps.enums.order;


import com.xqboss.common.enums.BaseEnum;

/**
 * 订单状态
 */
public enum OrderStatusEnum implements BaseEnum<Integer> {
    UN_PAY(0, "未付款", Code.UN_PAY),
    PAYED(1, "已付款", Code.PAYED),
    COMPLETED(10, "已完成", Code.COMPLETED),
    CANCEL(-1, "已取消", Code.CANCEL),
    CLOSE(-2, "已关闭", Code.CLOSE),
    REFUND(-3, "售后中", Code.REFUND),
    ;


    public final static class Code {
        public static final String UN_PAY = "UN_PAY";
        public static final String PAYED = "PAYED";
        public static final String COMPLETED = "COMPLETED";
        public static final String REFUND = "REFUND";
        public static final String CLOSE = "CLOSE";
        public static final String CANCEL = "CANCEL";
    }

    private final Integer value;
    private final String msg;
    private final String code;

    OrderStatusEnum(Integer value, String description, String code) {
        this.value = value;
        this.msg = description;
        this.code = code;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    public String getCode() {
        return code;
    }
}
